package com.jz.community.moduleshoppingguide.neighbor.net;


import com.jz.community.basecomm.bean.BaseResponseInfo;
import com.jz.community.basecomm.constant.Constant;
import com.jz.community.moduleshoppingguide.neighbor.bean.BlogsListBean;
import com.jz.community.moduleshoppingguide.neighbor.bean.CircleMessageBean;
import com.jz.community.moduleshoppingguide.neighbor.bean.CirclePersonsBean;
import com.jz.community.moduleshoppingguide.neighbor.bean.CircleUserInfoBean;
import com.jz.community.moduleshoppingguide.neighbor.bean.NearCircleListBean;
import com.jz.community.moduleshoppingguide.neighbor.bean.PublishTypeBean;
import com.jz.community.moduleshoppingguide.neighbor.bean.UploadImagesBean;

import java.util.List;

import io.reactivex.Observable;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Part;
import retrofit2.http.Path;
import retrofit2.http.Query;

public interface NeighborNetApi {
    @GET(Constant.NEIGHBOR_MAIN_USER + "user/exists")
    Observable<CircleMessageBean> initUserNeighbor();

    @GET(Constant.NEIGHBOR_NEAR)
    Observable<NearCircleListBean> initNearNeighbor(@Query("lat") String lat, @Query("lon") String lon, @Query("page") int page, @Query("size") int size);

    @GET(Constant.NEIGHBOR_MSG + "/{circle-id}")
    Observable<CircleMessageBean> initNeighborMsg(@Path("circle-id") String circleId, @Query("lat") String lat, @Query("lon") String lon);

    @PUT(Constant.NEIGHBOR_ADD)
    Observable<BaseResponseInfo> addNeighbor(@Body RequestBody body);

    @PUT(Constant.NEIGHBOR_QUIT)
    Observable<BaseResponseInfo> quitNeighbor(@Body RequestBody body);

    @GET(Constant.NEIGHBOR_PERSONS + "/{circle-id}" + "/users")
    Observable<CirclePersonsBean> initPersonsData(@Path("circle-id") String circleId, @Query("page") int page, @Query("size") int size);

    @GET(Constant.NEIGHBOR_PUBLISH_TIPS)
    Observable<PublishTypeBean> initTips();

    @Multipart
    @POST(Constant.NEIGHBOR_PUBLISH_UPLOAD)
    Observable<UploadImagesBean> uploadImages(@Part() List<MultipartBody.Part> parts);

    @POST(Constant.NEIGHBOR_PUBLISH)
    Observable<BaseResponseInfo> publishMessage(@Body RequestBody body);

    @GET(Constant.CIRCLE_DYNAMIC + "/{circle-id}" + "/blogs")
    Observable<BlogsListBean> circleDynamic(@Path("circle-id") String circle_id, @Query("page") int page, @Query("size") int size);


    @GET(Constant.NEIGHBOR_PERSONS_INFO + "/{user-id}" + "/blogInfo")
    Observable<CircleUserInfoBean> initUserInfo(@Path("user-id") String userId);

    @PUT(Constant.CIRCLE_DYNAMIC + "/{blog-id}" + "/favorite")
    Observable<BlogsListBean.EmbeddedBean.ContentBean.FavoriteBean> putFavorite(@Path("blog-id") String blog_id);
}
